<div id="page-title">
	<img src="<{$APPLICATION_URL}>/Themes/Default/Images/res-img/prods.png" width="50" height="50" class="left-align service-icn " alt="Create A New Product">
				<h1 class="page-heading">Create A New Product</h1>	
</div>

<div id="breadcrumb" class="transparent">
	<p>
		<img src="<{$APPLICATION_URL}>/Themes/Default/Images/res-img/home.png" class="home" alt="Slappit.com"> <a href="<{$APPLICATION_URL}>/Browse/index" title="Slappit.com Homepage">Home</a> / <a href="<{$APPLICATION_URL}>/Browse/MyAccount/index" title="Slappit.com User Panel">Website Admin Panel</a> / <a href="<{$APPLICATION_URL}>/Browse/EcommercePanel/index" title="E-Commerce Panel">E-Commerce Panel</a> / <a href="<{$APPLICATION_URL}>/Browse/ProductPanel/index" title="Products Panel">Product Panel</a> / <a href="<{$APPLICATION_URL}>/Browse/ProductPanel/create" title="Create A New Product">Create A New Product</a>

</div>
<div id="main-content">
	<article id="main-article">
	<ul id="filtering-nav">
		<li><a href="<{$APPLICATION_URL}>/Browse/MyAccount/index" title="Back To Main User Panel">Back To Main User Panel</a></li>
		<li><a href="<{$APPLICATION_URL}>/Browse/EcommercePanel/index" title="Back To The E-Commerce Panel">Back To The E-Commerce Panel</a></li>
		<li><a href="<{$APPLICATION_URL}>/Browse/Category/index/type/product" title="Category Panel">Category Panel</a></li>
		<li><a href="<{$APPLICATION_URL}>/Browse/ManufacturerPanel/index" title="Manufacturer Panel">Manufacturer Panel</a></li>
		<li><a href="<{$APPLICATION_URL}>/Browse/TaxPanel/index" title="VAT Panel">VAT Panel</a></li>		
		<li><a href="<{$currentUser->getHomeUrl()}>" target="blank" title="View Website Homepage">View Website Homepage</a></li>
	</ul>
					<{if $isDemoMode == true}>
					<p><h3 style="font-family:arial"><font color="red">THIS IS DEMO MODE. YOU CANNOT EDIT ANY INFORMATION HERE</font></h3><br/></p>
					<{/if}>
	<{if $countCatList == 0}>
		<p>
			<h3 style="font-family:arial">PLEASE ADD CATEGORY BEFORE ADDING A NEW PRODUCT</h3>
			<br/>
		</p>
	<{/if}>
	<{if $countTaxList == 0}>
		<p>
			<h3 style="font-family:arial">PLEASE ADD VAT OPTION BEFORE ADDING A NEW PRODUCT</h3>
			<br/>
		</p>
	<{/if}>
	<{if $countManuList == 0}>
		<p>
			<h3 style="font-family:arial">PLEASE ADD MANUFACTURER BEFORE ADDING A NEW PRODUCT</h3>
			<br/>
		</p>
	<{/if}>
	<form action="<{$APPLICATION_URL}>/Browse/ProductPanel/create" method="post" id="save-content" name="save_content" enctype="multipart/form-data">
		<div style="color:red;">
			<{foreach item=item from=$error}>
			<li>
				<{$item}>
			</li>
			 <{/foreach}>  
		</div>
		
		<ol class="forms">
			<li>
				<h2>Meta Section</h2>
				<p>
					<small>(Enter the title for your website here) Example: Domain.com
						- Buy computer parts here</small>
				</p></li>
			<li><label for="headTitle">Meta Title</label><input type="text"
				id="headTitle" name="headTitle" value="" <{if $isDemoMode == true}>readonly="readonly"<{/if}>></li>
			<li><p>
					<small>(Enter the description for your website here) Example:
						Domain.com - you can buy monitors, computer parts and network
						systems.</small>
				</p></li>
			<li><label for="metaDescription">Meta Desc</label><input type="text"
				id="metaDescription" name="metaDescription" value="" <{if $isDemoMode == true}>readonly="readonly"<{/if}>></li>
			<li><p>
					<small>(Enter the keywords for your website here) Example: Company
						Name, computers, monitors, components</small>
				</p></li>
			<li><label for="metaKeywords">Meta Keywords</label><input type="text"
				id="metaKeywords" name="metaKeywords" value="" <{if $isDemoMode == true}>readonly="readonly"<{/if}>></li>
			<li>
				<br/><br/>
				<h2>Product Details Section</h2>
			</li>
			<li>			
				<p>
					<small>(Please enter product name you want to create)</small>
				</p></li>			
			<li><label for="name">Product Name</label><input type="text"
				id="name" name="name" value=""></li>
			<li>
			<li><label for="categoryId" style="padding-right:20px;">Select Category</label>
				<select name="categoryId" id="categoryId" >
						<{foreach name=outer item=catItem from=$categoryList}>												
							<option value="<{$catItem->id}>" <{if $categoryId == $catItem->id}> selected="selected" <{/if}>><{$catItem->name}></option>							
						<{/foreach}>
				</select>
			</li>
			<li><label for="manufacturerId" style="padding-right:20px;">Manufacturer</label>
				<select name="manufacturerId" id="manufacturerId" >
						<{foreach name=outer item=manufacturerItem from=$manufacturerList}>												
							<option value="<{$manufacturerItem->id}>" <{if $manufacturerId == $manufacturerItem->id}> selected="selected" <{/if}>><{$manufacturerItem->name}></option>							
						<{/foreach}>
				</select>
			</li>
			<li>Image
			  <input type='file' id='picture' name='picture' style='padding: 0px;'></li>
			<li>
				<p>
					<small>(Please enter product description)</small>
				</p></li>
			<li><label for="description">Description</label><textarea name="description" id="description" cols="30" rows="12"><{$content}></textarea></li>
			<li><label for="taxId" style="padding-right:20px;">Select VAT</label>
				<select name="taxId" id="taxId" >
						<{foreach name=outer item=taxItem from=$taxList}>												
							<option value="<{$taxItem->id}>" <{if $taxId == $taxItem->id}> selected="selected" <{/if}>><{$taxItem->name}></option>							
						<{/foreach}>
				</select>
			</li>
			<li><label for="price">Product Price</label><input type="text"
				id="price" name="price" value=""></li>
			<li><label for="model">Product Model</label><input type="text"
				id="model" name="model" value=""></li>
			<li><label for="quantity">Quantity</label><input type="text"
				id="quantity" name="quantity" value=""></li>
			<li><label for="weight">Weight</label><input type="text"
				id="weight" name="weight" value=""></li>
			<li>
			<li><a id="submit-form" class="silver-button" <{if $isDemoMode == false}>onclick="return formSubmit();"<{/if}>>Save</a></li>
		</ol>
		<input type="hidden" id="actionForm" name="actionForm" value=""/>		
	</form>
	<div id="service-page">
		<div class="clear"></div>
	</div>

	</article>

</div>
<div class="space transparent">
	<a href="#top" id="scroll-top"><img
		src="<{$APPLICATION_URL}>/Themes/Default/Images/res-img/top.png"
		alt="Back to the top"> </a>
</div>


<script type="text/javascript">
    function formSubmit()
    {
    	var theform = document.save_content;
    	
    	// Check Name
    	var name = theform.name.value;
    	if (name == ''){
			alert('Name is invalid');
			theform.name.focus();
			return false;
    	} 	
    	

    	theform.actionForm.value = 'submit';
    	theform.submit();
    	return true;
    }
</script>
